package com.qyt.hotel.service.impl;

import com.qyt.hotel.dao.UserMapper;
import com.qyt.hotel.entity.User;
import com.qyt.hotel.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User checkUser(User user) {
        return userMapper.checkLoginIdAndLoginPwd(user);
    }

    @Override
    public String getLoginId(User user) {
        return userMapper.getLoginId(user);
    }

    @Override
    public String getLoginPwd(User user) {
        return userMapper.getLoginPwd(user);
    }


    @Override
    public User getOne(User user) {
        return userMapper.getOne(user);
    }

    @Override
    public void registry(User user) {
        user.setNickName("超级小飞侠");
        user.setPhone("18307008806");
        user.setPhoto("admin_default.png");
        user.setRoleId("1");
        userMapper.insert(user);
    }
}
